<template>
    <!-- <a-table
        class="ant-table-striped"
        :columns="columns"
        :data-source="data"
        :scroll="{ x: 2800, y: 0 }"
        style="width: 98%; margin: 0 auto; margin-top: 15px"
        :row-selection="rowSelection"
        :pagination="false"
        :rowClassName="(_, index) => (index % 2 === 1 ? 'table-striped' : null)"
        bordered
    >
        <template #auditstatus>
        </template>
        <template #action>
            <a>action</a>
        </template>
    </a-table> -->
    <a-table :data-source="data"   :row-selection="rowSelection" :scroll="{ x: 2835, y: 0 }" :bordered="true" :rowClassName="(_, index) => (index % 2 === 1 ? 'table-striped' : null)" style="width: 98%; margin: 0 auto; margin-top: 15px" class="ant-table-striped" :pagination="false">
        <a-table-column key="id" title="ID" data-index="id" :width="80" />
        <a-table-column key="img" title="照片" data-index="img" :width="80" align="center">
            <template #default="{ record }">
                <a-avatar :src="record.img" :size="50" style="margin-left:-2px" />
            </template>
        </a-table-column>
        <a-table-column key="name" title="姓名" data-index="name" :width="120" />
        <a-table-column key="wxbind" title="微信绑定" data-index="wxbind" :width="100">
            <template #default="{ record }">
                <span v-if="record.wxbind">已绑定</span>
                <span v-else>未绑定</span>
            </template>
        </a-table-column>
        <a-table-column key="educationback" title="学历" data-index="educationback" :width="90" />
        <a-table-column key="experience" title="经验" data-index="experience" :width="75">
            <template #default="{ record }">
                <span>{{record.experience}}年</span>
            </template>
        </a-table-column>
        <a-table-column key="integrityrungs" title="简历完整度" data-index="integrityrungs" :width="170">
            <template #default="{ record }">
                <a-progress :percent="record.integrityrungs" size="small" strokeColor="rgb(29, 183, 90)" v-if="(record.integrityrungs>50 && record.integrityrungs<80)" />
                <a-progress :percent="record.integrityrungs" size="small" strokeColor="rgb(251, 60, 17)" v-else-if="(record.integrityrungs<=50)" />
                <a-progress :percent="record.integrityrungs" size="small" v-else />
            </template>
        </a-table-column>
        <a-table-column key="auditstatus" title="审核状态" data-index="auditstatus" :width="120">
            <template #default="{ record }">
                <span v-if="record.auditstatus">已审核</span>
                <span v-else>已拒绝</span>
            </template>
        </a-table-column>
        <a-table-column key="concatway1" title="简历联系方式" data-index="concatway1" :width="130">
            <template #default="{ record }">
                <span style="margin-left:-4px">{{record.concatway1}}</span><img src="../../imgs/下载.png" alt="" style="margin-left:4px;width:14px;margin-top: -3px;">
            </template>
        </a-table-column>
        <a-table-column key="concatway2" title="会员联系方式" data-index="concatway2" :width="130">
            <template #default="{ record }">
                <span style="margin-left:-4px">{{record.concatway2}}</span><img src="../../imgs/下载.png" alt="" style="margin-left:4px;width:14px;margin-top: -3px;">
            </template>
        </a-table-column>
        <a-table-column key="grade" title="等级" data-index="grade" :width="90">
            <template #default="{ record }">
                <span v-if="record.grade">优质</span>
                <span v-else>普通</span>
            </template>
        </a-table-column>
        <a-table-column key="delivernumber" title="投递数" data-index="delivernumber" :width="90" />
        <a-table-column key="bedownloaded" title="被下载" data-index="bedownloaded" :width="90" />
        <a-table-column key="beviewed" title="被查看" data-index="beviewed" :width="90" />
        <a-table-column key="beonesside" title="被面邀" data-index="beonesside" :width="90" />
        <a-table-column key="refreshtime" title="刷新时间" data-index="refreshtime" :width="160" />
        <a-table-column key="logintime" title="登录时间" data-index="logintime" :width="160" />
        <a-table-column key="registtime" title="注册时间" data-index="registtime" :width="160" />
        <a-table-column key="concatstatus" title="联系状态" data-index="concatstatus" :width="120">
            <template #default="{ record }">
                <img src="../../imgs/电话1.png" v-if="record.concatstatus1" style="margin-left:20px;width: 16px;" />
                <img src="../../imgs/电话.png" v-else style="margin-left:20px;width: 16px;" />
                <img src="../../imgs/微信1.png" v-if="record.concatstatus2" style="margin-left:10px;width: 16px;" />
                <img src="../../imgs/微信.png" v-else style="margin-left:10px;width: 16px;" />
            </template>
        </a-table-column>
        <a-table-column key="followupnum" title="跟进次数" data-index="followupnum" :width="110" />
        <a-table-column key="lastfollow" title="最后跟进" data-index="lastfollow" :width="160">
            <template #default="{ record }">
                <span v-if="record.lastfollow!=''">{{record.lastfollow}}</span>
                <span v-else>-</span>
            </template>
        </a-table-column>
        <a-table-column key="comment" title="简历备注" data-index="comment" :width="180">
            <template #default="{ record }">
                <span v-if="record.comment!=''">{{record.comment}}</span>
                <span v-else>-</span>
            </template>
        </a-table-column>
        <a-table-column key="action" title="操作" fixed="right">
            <template #default="{ record }">
                <a @click="showDrawer">查看</a>
                <a style="margin-left:10px">跟进</a>
                <a style="margin-left:10px">审核</a>
                <a style="margin-left:10px">删除</a>
            </template>
        </a-table-column>
    </a-table>
</template>
<script lang="ts">
import { defineComponent,onMounted,ref,defineEmits } from "vue";
import { array } from "vue-types";
export default defineComponent({
    name:"resumetable",
    props:{
        datas:array,
    },
    setup(props,contents){
        const columns = props.columns
        const data = props.datas
        const rowSelection = {
            onChange: (selectedRowKeys: any, selectedRows: any) => {
                console.log(
                `selectedRowKeys: ${selectedRowKeys}`,
                "selectedRows: ",
                selectedRows
                );
            },
            getCheckboxProps: (record: any) => ({
                disabled: record.name === "Disabled User",
                // Column configuration not to be checked
                name: record.name,
            }),
        };
        const showDrawer = () => {
            contents.emit("showDrawer")
        }
        onMounted(() => {
            
        })
        return{
            columns,
            data,
            rowSelection,
            showDrawer,
        }
    },
});
</script>
<style lang="scss" scoped>
.ant-table-striped :deep(.table-striped) td {
    background-color: #fafafa;
}
</style>